package com.zhang.Builder.example;

import java.util.ArrayList;

/**
 * @author ElloeStudy(Sifa Zhang)
 * @create 2022-03-04 16:57
 * To: 真常应物，真常得性，常清常静，常清静矣
 */
public class Client1 {
    public static void main(String[] args) {
        // 模型按照这个顺序来启动
        ArrayList<String> sequence = new ArrayList<>();
        sequence.add("engineboom");
        sequence.add("start");
        sequence.add("stop");
        // 生产一个模型
        BenzBuilder benzBuilder = new BenzBuilder();
        // 顺序给这个builder类，制造出这样一个车出来
        benzBuilder.setSequence(sequence);
        // 制造出一个奔驰车
        BenzModel benzModel = (BenzModel) benzBuilder.getCarModel();
        benzModel.run();

        System.out.println("===========");
        // 生产一个宝马模型,可以实现模块化加工
        BMWBuilder bmwBuilder = new BMWBuilder();
        bmwBuilder.setSequence(sequence);
        BMWModel bmwModel = (BMWModel) bmwBuilder.getCarModel();
        bmwModel.run();
    }
}
